<?php
namespace core\lib\drive\log;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
use core\lib\config;
/**
 * Description of file
 *
 * @author gangguo
 */
class file {
    //put your code here
    public $path = 'null';


    public function __construct() {
        $this->path = FastPHP.'/runtime/log/';//config::get('PATH','log');
    }
    public function log($message,$file){
        if(!is_dir($this->path)){
            mkdir($this->path,'0777',TRUE);
        }
        $file_path = $this->path.$file.'.log';
        if(!is_file($file_path)){
            touch($file_path);
        }
        $message = '['.date('H:i:s').'] '.$message.PHP_EOL;
        file_put_contents($file_path, $message,FILE_APPEND);
    }
}
